<?php
/*
 * Created on Feb 10, 2008
 *
 * This is an open source software, please obey the GPL
 * The Referee Service is offered by Cacomand Inc. 
 * View Http://www.cacomand.com for support or more information
 * You can also view distrema.googlecode.com to join the community.
 * NEED A confirm.php in the same folder.
 */
 include("../lib/lib_travel_agency.php");
 if($route=travel_agency::get_focused_route() AND $apply_user=get_current_user_obj() AND strlen($_POST["set_off_month"])<=2 AND strlen($_POST["set_off_day"])<=2)
 {
 	if(strlen($_POST["set_off_month"])==1)
 		$set_off_month="0".$_POST["set_off_month"];
 	else
 		$set_off_month=$_POST["set_off_month"];
 	if(strlen($_POST["set_off_day"])==1)
 		$set_off_day="0".$_POST["set_off_day"];
 	else
 		$set_off_day=$_POST["set_off_day"];
 	$set_off_time=$_POST["set_off_year"]."-".$set_off_month."-".$set_off_day;
 	$tf=new trip($route->route_full_name.".".$set_off_time);
 	travel_agency::focus_trip($tf);
 	$apply_user->reset_record(23,"姓名",$_POST["realname"]);
 	$apply_user->reset_record(14,"常用",$_POST["mobile"]);
 	$apply_user->reset_record(24,"空",$_POST["gender"]);
 	$apply_user->reset_record(21,$route->route_full_name.".".$set_off_time,$_POST["pick_up_address"]);
 	send_data($apply_user,$route->agency,19,$route->route_full_name.".".$set_off_time,$apply_user->epsn.".".$apply_user->user_ID);
 	$selected=true;
 	$default_service=new travel_agency();
 	if($_POST["gender"]=="男")
 		$after_call="先生";
 	else
 		$after_call="小姐";
 	$str=$_POST["realname"].$after_call."报名参加了".$set_off_time."出发的".$route->route_name."团。他（她）的联系电话是：".$_POST["mobile"];
 	$smtpserver = "mail.cacomand.com";//SMTP服务器
	$smtpserverport =25;//SMTP服务器端口
	$smtpusermail = "webservice@cacomand.com";//SMTP服务器的用户邮箱
	$smtpemailto = "25409597@qq.com";//发送给谁
	$smtpuser = "webservice@cacomand.com";//SMTP服务器的用户帐号
	$smtppass = "123456";//SMTP服务器的用户密码
	$mailsubject = "有新用户报名参加旅行团！";//邮件主题
	$mailbody = $str;//邮件内容
	$mailtype = "TXT";//邮件格式（HTML/TXT）,TXT为文本邮件
	
	$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);//这里面的一个true是表示使用身份验证,否则不使用身份验证.
	$smtp->debug = false;//是否显示发送的调试信息
	$return = ($smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype));
	echo $return;
 }
 else
 {
 	$selected=false;
 }
 //$selected,$route can be used
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>订单确认</title>
<link href="style.css" rel="stylesheet" type="text/css" /></head>

<body>

<div class="wrap">
<div id="top">
  <div style="padding-left:27px; padding-top:37px"><a href="index.php"><img alt=""  src="images/logo.jpg" width="261" height="53" border="0" /></a></div>
  <div style="padding-left:92px; padding-top:45px"><a href="routes.html"><img alt=""  src="images/h1.jpg" width="51" height="16" border="0" style="margin-right:82px " /></a><a href="view_trips.php"><img alt=""  src="images/h2.jpg" width="51" height="16" border="0" style="margin-right:92px " /></a><a href="pay_for_trips.php"><img alt=""  src="images/h3.jpg" width="51" height="16" border="0" style="margin-right:87px " /></a><a href="../user_login.php" target="blank"><img alt=""  src="images/h4.jpg" width="51" height="16" border="0" style="margin-right:83px " /></a><a href="contact.html"><img alt=""  src="images/h5.jpg" width="51" height="16" border="0" /></a></div>
  </div>
<div id="content">
<!--*********************************************************************************-->
<div style="padding-left:30px; padding-top:10px">
  <div class="title" style="width:642px "><span class="title" style="width:642px "><img  src="images/latecs_5.jpg" alt="" width="139" height="16" style="margin-left:12px " /></span></div>
</div>
<div style="padding-left:42px; padding-top:23px; padding-right:40px">
  <?php
 	if($selected)
 	{
	 	echo("确认报名参加".$set_off_time."出发的".$route->route_name."团.<br />");
	 	give_a_confirm_form("finish.php","报名参加旅行团",$default_service);
 	}
 	else
 	{
 		echo("您未登录或者未选定线路");
 	}
  ?>
</div>
<span class="link_green_light"><a href="#">
<!--*********************************************************************************-->
</a></span></div>

<div id="footer" class="clear">
<div align="right" class="text1" style="padding-right:28px; padding-top:42px "><a href="index.php" class="text1"><strong>主页</strong></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="text_green">|</span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="routes.html" class="text1"><strong>浏览所有线路</strong></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="text_green">|</span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="view_trips.php" class="text1"><strong>我的行程</strong></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="text_green">|</span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="pay_for_trips.php" class="text1"><strong>在线付款</strong></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="text_green">|</span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../user_login.php" target="blank" class="text1"><strong>用户管理</strong></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="text_green">|</span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="contact.html" class="text1"><strong>联系我们</strong></a><br />
<br style="line-height:5px " />
Copyright &copy; Cacomand Inc., 2008&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="DistRema.html" class="text_orange">Visit Cacomand</a></div>
</div>
</div>
</body>
</html>
